﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevExpress.ExpressApp;
using WinSCM.Module.Model;

namespace WinSCM.Module.UserControls
{
    public partial class NavImage_1 : UserControl, INavImageUserControl
    {
        public NavImage_1()
        {
            InitializeComponent();
        }
        private XafApplication _xafApplication;
        public XafApplication XafApplication
        {
            get
            {
                return _xafApplication;
            }
            set
            {
                _xafApplication = value;
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            IObjectSpace objectSpace = XafApplication.CreateObjectSpace();
            ShowViewParameters svp = new ShowViewParameters();
            svp.CreatedView = XafApplication.CreateListView(objectSpace, typeof(采购订单), true);
            svp.TargetWindow = TargetWindow.Current;
            svp.Context = TemplateContext.View;
            svp.CreateAllControllers = true;
            ShowViewSource svs = new ShowViewSource(XafApplication.MainWindow, null);
            XafApplication.ShowViewStrategy.ShowView(svp, svs);
        }
    }
}
